/*****************************************************************
 *@Copyright all rights reserved ? 2014 Yuga
 *@author YUga studio
 *Contact: zengkang007@gmail.com
 *****************************************************************/
package com.oplink.webbase.modules.invoicing.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.oplink.webbase.common.persistence.DataEntity;
import com.oplink.webbase.modules.sys.entity.User;

/**
 * 告警Entity
 * 
 * @author YUga studio
 * @version 2015-01-12
 */
@Entity
@Table(name = "invoicing_sub_stock")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SubStock extends DataEntity {

	private static final long serialVersionUID = 1L;
	private User user;
	private int sort; // ����
	private String stockFormId; // 销售单编号
	private String goodsId; // 参考商品资料
	private String costPrice; // 销售人员编号
	private String salePrice; //
	private String goodsState; // 成本价
	private Integer stockQuantity; // 库存数量
	private Integer minReserves; // 最低储备
	private Integer norReserves; // 正常储备
	private Integer maxReserves; // 最大储备
	private Date recentOperDate; // 最近操作时间

	public String getStockFormId() {
		return stockFormId;
	}

	public void setStockFormId(String stockFormId) {
		this.stockFormId = stockFormId;
	}

	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}

	public String getCostPrice() {
		return costPrice;
	}

	public void setCostPrice(String costPrice) {
		this.costPrice = costPrice;
	}

	public String getSalePrice() {
		return salePrice;
	}

	public void setSalePrice(String salePrice) {
		this.salePrice = salePrice;
	}

	public String getGoodsState() {
		return goodsState;
	}

	public void setGoodsState(String goodsState) {
		this.goodsState = goodsState;
	}

	public Integer getStockQuantity() {
		return stockQuantity;
	}

	public void setStockQuantity(Integer stockQuantity) {
		this.stockQuantity = stockQuantity;
	}

	public Integer getMinReserves() {
		return minReserves;
	}

	public void setMinReserves(Integer minReserves) {
		this.minReserves = minReserves;
	}

	public Integer getNorReserves() {
		return norReserves;
	}

	public void setNorReserves(Integer norReserves) {
		this.norReserves = norReserves;
	}

	public Integer getMaxReserves() {
		return maxReserves;
	}

	public void setMaxReserves(Integer maxReserves) {
		this.maxReserves = maxReserves;
	}

	public Date getRecentOperDate() {
		return recentOperDate;
	}

	public void setRecentOperDate(Date recentOperDate) {
		this.recentOperDate = recentOperDate;
	}

	// JPA ����USER_ID�еĶ��һ��ϵ����
	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Transient
	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}
}
